#pragma once

#include "CDMDevice.h"
#include "CDMChannel.h"

void FTRACE(LPCTSTR pszFormat, ...);
void GetTreeItemImage(CCDMDevice* pDevice, int &nImg, int &nImgSelected);
void GetTreeItemImage(CCDMChannel* pChannel, int &nImg, int &nImgSelected);
void GetTreeItemImage(CDeviceGroup* pGroup, int &nImg, int &nImgSelected);

BOOL PlayTime2DateTime(CString strDateTime, int &nYear, int &nMonth, int &nDay, int &nHour, int &nMinute, int &nSecond);
BOOL PlayTime2DateTime(CString strDateTime, time_t &datetime);
BOOL PlayTime2DateTime(CString strDateTime, SYSTEMTIME &systemtime);

BOOL StringTime2DateTime(CString strDateTime, SYSTEMTIME &systemtime);
BOOL StringTime2DateTime(CString strDateTime, time_t &datetime);

BOOL DateTime2PlayTime(SYSTEMTIME systemtime, CString &strPlayTime);

BOOL DirectoryExists(TCHAR* pdir);
BOOL ForceDirectories(TCHAR* pathname);
BOOL ForceFullDirectories(TCHAR* pathname);
//HANDLE FindProcess(CString szprocessname);
HWND FindMyWindow(CString headtxt, CString tailtxt);